/**
 * Carefree Theme - Index Page Styles
 * Hero section, featured articles, and homepage specific styles
 */

/* ========== Hero Section ========== */
.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: var(--spacing-4xl) 0;
    overflow: hidden;
    margin-top: calc(var(--header-height) * -1);
    padding-top: calc(var(--header-height) + var(--spacing-4xl));
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-Carefree);
    background-size: 200% 200%;
    animation: Carefree 15s ease infinite;
    opacity: 0.08;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--color-bg), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--gradient-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.6s var(--easing) forwards;
}

.hero-badge i {
    font-size: 0.875em;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.6s var(--easing) 0.1s forwards;
    opacity: 0;
}

.hero-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    animation: fadeInUp 0.6s var(--easing) 0.2s forwards;
    opacity: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: fadeInUp 0.6s var(--easing) 0.3s forwards;
    opacity: 0;
}

.hero-stats {
    display: flex;
    gap: var(--spacing-3xl);
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-2xl);
    border-top: 1px solid var(--color-border-light);
    animation: fadeInUp 0.6s var(--easing) 0.4s forwards;
    opacity: 0;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.hero-stat-value span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ========== Hero Slider ========== */
.hero-slider {
    position: relative;
    min-height: 500px;
    margin-top: calc(var(--header-height) * -1);
}

.slider-item {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-alt);
}

.slider-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(118, 75, 162, 0.8) 100%);
}

.slider-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: calc(var(--header-height) + var(--spacing-4xl)) var(--spacing-xl) var(--spacing-4xl);
    color: white;
}

.slider-content h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    color: white;
    line-height: 1.2;
}

.slider-content p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
    color: white;
}

.slider-content .btn-primary {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.slider-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ========== Featured Section ========== */
.featured-section {
    padding: var(--spacing-4xl) 0;
    position: relative;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.featured-card {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.featured-card.large {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

.featured-card .card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform var(--duration-slow) var(--easing);
}

.featured-card:hover .card-bg {
    transform: scale(1.1);
}

.featured-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    transition: background var(--duration-normal) var(--easing);
}

.featured-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

.featured-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-xl);
    color: white;
    z-index: 1;
}

.featured-card .card-category {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    transition: background var(--duration-fast) var(--easing);
}

.featured-card:hover .card-category {
    background: var(--color-primary);
}

.featured-card .card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.featured-card.large .card-title {
    font-size: var(--font-size-2xl);
}

.featured-card .card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.7);
}

/* ========== Latest Articles Section ========== */
.latest-section {
    padding: var(--spacing-4xl) 0;
}

.latest-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--spacing-2xl);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Article Card - Horizontal */
.article-card-horizontal {
    display: flex;
    gap: var(--spacing-xl);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--duration-normal) var(--easing);
}

.article-card-horizontal:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.article-card-horizontal .card-image {
    flex-shrink: 0;
    width: 240px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-card-horizontal .card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform var(--duration-normal) var(--easing);
}

.article-card-horizontal:hover .card-image img {
    transform: scale(1.05);
}

.article-card-horizontal .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
}

.article-card-horizontal .card-category {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: fit-content;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.article-card-horizontal .card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.article-card-horizontal .card-title a {
    color: var(--color-text);
    transition: color var(--duration-fast) var(--easing);
}

.article-card-horizontal .card-title a:hover {
    color: var(--color-primary);
}

.article-card-horizontal .card-excerpt {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.article-card-horizontal .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-card-horizontal .card-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.article-card-horizontal .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.article-card-horizontal .author-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.article-card-horizontal .card-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.article-card-horizontal .card-stats span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Article Grid Cards */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.article-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    transition: all var(--duration-normal) var(--easing);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.article-card .article-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.article-card .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--easing);
}

.article-card:hover .article-image img {
    transform: scale(1.08);
}

.article-card .article-flag {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--gradient-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-md);
}

.article-card .article-body {
    padding: var(--spacing-lg);
}

.article-card .article-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.article-card .article-title a {
    color: var(--color-text);
    transition: color var(--duration-fast) var(--easing);
}

.article-card .article-title a:hover {
    color: var(--color-primary);
}

.article-card .article-summary {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.article-card .article-meta span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ========== Categories Section ========== */
.categories-section {
    padding: var(--spacing-4xl) 0;
    background: var(--color-surface);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.category-card {
    position: relative;
    padding: var(--spacing-xl);
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    text-align: center;
    transition: all var(--duration-normal) var(--easing);
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--duration-normal) var(--easing);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card .category-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    font-size: 1.5rem;
    border-radius: var(--radius-xl);
    transition: all var(--duration-normal) var(--easing);
}

.category-card:hover .category-icon {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1);
}

.category-card .category-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.category-card .category-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ========== Tags Section ========== */
.tags-section {
    padding: var(--spacing-4xl) 0;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

.tags-cloud .tag {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* ========== Newsletter Section ========== */
.newsletter-section {
    padding: var(--spacing-4xl) 0;
    position: relative;
    overflow: hidden;
}

.newsletter-card {
    position: relative;
    padding: var(--spacing-4xl);
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    text-align: center;
    color: white;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite;
}

.newsletter-card .newsletter-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.newsletter-card .newsletter-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: white;
}

.newsletter-card .newsletter-text {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto var(--spacing-xl);
    color: white;
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 480px;
    margin: 0 auto;
}

.newsletter-form .input {
    flex: 1;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
}

.newsletter-form .input::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-form .input:focus {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    box-shadow: none;
}

.newsletter-form .btn {
    background: white;
    color: var(--color-primary);
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: 600;
}

.newsletter-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ========== Links Section ========== */
.links-section {
    padding: var(--spacing-3xl) 0;
    background: var(--color-surface);
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

.link-item {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    transition: all var(--duration-fast) var(--easing);
}

.link-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.link-item img {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-card.large {
        grid-column: span 2;
        grid-row: span 1;
        aspect-ratio: 2 / 1;
    }

    .latest-grid {
        grid-template-columns: 1fr;
    }

    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-description {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-stats {
        justify-content: center;
    }

    .slider-content {
        text-align: center;
    }

    .slider-content h2 {
        font-size: 2rem;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card.large {
        grid-column: span 1;
        aspect-ratio: 16 / 9;
    }

    .article-card-horizontal {
        flex-direction: column;
    }

    .article-card-horizontal .card-image {
        width: 100%;
    }

    .article-card-horizontal .card-image img {
        height: 200px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .newsletter-card {
        padding: var(--spacing-2xl);
    }

    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }
}
